﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BulkUpdate2.aspx.cs" Inherits="MLY.LTR.BulkUpdate2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
    <title>
    <asp:Literal ID="TitleLiteral" runat="server"></asp:Literal>
    </title>
    <link href="../Style/ReportsStylesheet.css" rel="stylesheet" type="text/css" />
    <link href="../Style/General_Style_v9.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="InerTextStyle">
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager> 
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
        <table cellpadding="5" cellspacing="0">
        <tr>
        <td>
            <asp:Label ID="DateStringTitleLabel" runat="server" Text="<%$Dict:advancedRptPrams.chooseDateFilter: %>"></asp:Label>
        </td>
        <td colspan="3">
            <asp:DropDownList runat="server" ID="DateTypeDDL">
                <asp:ListItem Text="<%$Dict:clientAddWo.SendDate %>" Value="1" Selected="True"></asp:ListItem>
                <asp:ListItem Text="<%$Dict:clientAddWo.PlannedDelivaryDate %>" Value="2"></asp:ListItem>                        
                <asp:ListItem Text="<%$Dict:clientAddWo.DateFieldB %>" Value="3"></asp:ListItem>                   
                <asp:ListItem Text="<%$Dict:clientAddWo.ActualDelivaryDate %>" Value="4"></asp:ListItem>                                            
            </asp:DropDownList>
        </td>
        </tr>
        <tr>
        <td>
            <asp:Label ID="DateFromTitleLabel" runat="server" Text="<%$Dict:reportsParams.Between %>"></asp:Label>
        </td>
        <td>
            <KBMControls:KBMReadOnlyTxtBox runat="server" ID="txtFromDate"></KBMControls:KBMReadOnlyTxtBox>
            <KBMValidators:requiredValidator ID="RequiredValidator1" runat="server" ControlToValidate="txtFromDate" ErrorMessage="<%$Dict:reportsParams.MustChooseBetweenTime %>">
            </KBMValidators:requiredValidator>
            <KBMControls:KbmCalendar TargetControlID="txtFromDate" runat="server" ID="KbmCalendar11">
            </KBMControls:KbmCalendar>
        </td>
        
        <td>
            <asp:Label ID="DateTillTitleLabel"  runat="server"  Text='<%$Dict:reportsParams.And %>'></asp:Label>
        </td>
        <td>
            <KBMControls:KBMReadOnlyTxtBox runat="server" ID="txtToDate"></KBMControls:KBMReadOnlyTxtBox>
            <%--<KBMValidators:BiggerThenEqualDateValidator ID="BiggerThenEqualDateValidator1" Display="None"
                errorMessage='<%$Dict:reportsParams.ToDateSmallerThenFromDate %>' ControlToCompare="txtFromDate"
                ControlToValidate="txtToDate" runat="server"></KBMValidators:BiggerThenEqualDateValidator>--%>
            <KBMValidators:requiredValidator ID="RequiredValidator2" ControlToValidate="txtToDate" ErrorMessage='<%$Dict:reportsParams.MustChooseToDate %>'
                runat="server"></KBMValidators:requiredValidator>
            <KBMControls:KbmCalendar TargetControlID="txtToDate" runat="server" ID="KbmCalendar12">
            </KBMControls:KbmCalendar>
        </td>
        </tr>
        <tr>
        <td>
            <asp:Label ID="ProjectTitleLabel" runat="server" Text="<%$Dict:clientAddWo.Project %>"></asp:Label>
             
        </td>
        <td>
            <asp:TextBox ID="ProjectTextBox" runat="server" Width="200" MaxLength="255"></asp:TextBox>
        </td>
        </tr>
        <tr>
        <td>
            <asp:Label ID="OrganizationTitleLabel" Text='<%$Dict:reportsParams.ChooseOrganization: %>' runat="server"></asp:Label>
        </td>
        <td>
            <asp:DropDownList ID="ddlOrgs" runat="server" DataTextField="OrganizationName" DataValueField="OrganizationId"></asp:DropDownList>
        </td>
        </tr>
        </table>
        <asp:Button ID="SetPopulationButton" runat="server" Text='<%$Dict:General.Submit%>' OnClick="SetPopulation" />
        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
                <asp:Image ID="ProgressImage1" runat="server" ImageUrl="~/Images/ajax-loaderBar.gif" />
            </ProgressTemplate>
        </asp:UpdateProgress>
        <br /><hr /><br />
        <asp:Panel ID="ResultsPanel" runat="server" Visible="false" >
        <table>
            <tr>
            <td>
                <asp:CheckBox ID="PlannedDeliveryDateCB" runat="server" Text="Move Planned delivery date by" />
            </td>
            <td>
                <asp:TextBox ID="PlannedDaysText" runat="server" Width="50" MaxLength="3"></asp:TextBox>
                <asp:Label ID="PlannedDaysLabel" runat="server" Text="days"></asp:Label>
            </td>
            </tr>
            <tr>
            <td>
                <asp:CheckBox ID="RequestedDeliveryDateCB" runat="server" Text="Move Requested delivery date by" />
            </td>
            <td>
                <asp:TextBox ID="RequestedDaysText" runat="server" Width="50" MaxLength="3"></asp:TextBox>
                <asp:Label ID="RequestedDaysLabel" runat="server" Text="days"></asp:Label>
            </td>
            </tr>
            <tr>
            <td>
                <asp:CheckBox ID="PriorityCB" runat="server" Text="Set customer priority to be" />
            </td>
            <td>
                <asp:TextBox ID="PriorityText" runat="server" Width="50" MaxLength="3"></asp:TextBox>
            </td>
            </tr>
            <tr>
            <td>
                <asp:CheckBox ID="RemarksCB" runat="server" Text="Set Remarks to be" />
            </td>
            <td>
                <asp:TextBox ID="RemarksTextBox" runat="server" Width="150" MaxLength="4000"></asp:TextBox>
            </td>
            </tr>
        </table>
        <br />
        <asp:Button ID="ActionButton" runat="server" Text='<%$Dict:General.Submit%>' OnClick="BulkUpdateClick" CausesValidation="false" />
        <br />
        <asp:Label ID="ErrorLabel" runat="server"></asp:Label>
        <br /><hr /><br />
        <asp:GridView ID="PopulationGrid" runat="server" AllowPaging="false" AutoGenerateColumns="false" DataSourceID="RecordsDataSource" >
        <HeaderStyle CssClass="GridTitleStyle" />
        <RowStyle CssClass="InerTextStyle" />
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="SelectedCheckBox" Checked="true" runat="server" />
                    <asp:HiddenField ID="WorkOrderIdHF" runat="server" Value='<%# Eval("WorkOrderId") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Dict:Clients.OrganizationName %>">
                <ItemTemplate>
                    <asp:Label ID="OrgNameLabel" runat="server" Text='<%# MLY.SessParam.IsClient ? Eval("ContractorOrganizationName") : Eval("CustomerOrganizationName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="<%$ Dict:clientAddWo.Project %>" DataField="Project" />
            <asp:BoundField HeaderText="<%$ Dict:clientAddWo.ContractorWorkOrderNumber %>" DataField="ContractorWorkOrderNumber" />
            <asp:BoundField HeaderText="<%$ Dict:clientAddWo.CustomerWorkOrderNumber %>" DataField="CustomerWorkOrderNumber" />
            <asp:BoundField HeaderText="<%$ Dict:InventoryGrid.PriorityColumn %>" DataField="CustomerPriority" />
            <asp:BoundField HeaderText="<%$ Dict:ClienteditWoForm.RequestedDelivaryDate %>" DataField="RequestedDelivaryDate" />
            <asp:BoundField HeaderText="<%$ Dict:ClienteditWoForm.PlannedDelivaryDate %>" DataField="PlannedDelivaryDate" />
            <asp:BoundField HeaderText="<%$ Dict:InventoryGrid.RemarksColumn %>" DataField="Remarks" />
        </Columns>
        <EmptyDataTemplate>No records selected</EmptyDataTemplate>
        
        </asp:GridView>
             
              
        </asp:Panel>
       
        <asp:SqlDataSource ID="RecordsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>"
         SelectCommandType="StoredProcedure" SelectCommand="BulkUpdateGetPopulation"></asp:SqlDataSource> 
         <%--<asp:SqlDataSource ID="PopulationDataSource" runat="server" SelectCommandType="Text"
         ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" SelectCommand="SELECT * FROM WorkOrdersView"></asp:SqlDataSource> --%>
        </ContentTemplate>
        </asp:UpdatePanel>
        
    </div>
    </form>
</body>
</html>
